package com.aspose.cells;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;

public class Range {
   Cells a;
   private String c;
   Object b;
   private CellArea d = new CellArea();

   public Iterator iterator() {
      return new zhg(this.a, this.d, false, 7);
   }

   public boolean isIntersect(Range range) {
      if (this.a != range.a) {
         return false;
      } else {
         int var2 = this.d.StartRow < range.d.StartRow ? range.d.StartRow : this.d.StartRow;
         int var3 = this.d.EndRow > range.d.EndRow ? range.d.EndRow : this.d.EndRow;
         if (var2 > var3) {
            return false;
         } else {
            var2 = this.d.StartColumn < range.d.StartColumn ? range.d.StartColumn : this.d.StartColumn;
            var3 = this.d.EndColumn > range.d.EndColumn ? range.d.EndColumn : this.d.EndColumn;
            return var2 <= var3;
         }
      }
   }

   public Range intersect(Range range) {
      if (this.a != range.a) {
         return null;
      } else {
         int var2 = this.d.StartRow < range.d.StartRow ? range.d.StartRow : this.d.StartRow;
         int var3 = this.d.EndRow > range.d.EndRow ? range.d.EndRow : this.d.EndRow;
         if (var2 > var3) {
            return null;
         } else {
            int var4 = this.d.StartColumn < range.d.StartColumn ? range.d.StartColumn : this.d.StartColumn;
            int var5 = this.d.EndColumn > range.d.EndColumn ? range.d.EndColumn : this.d.EndColumn;
            if (var4 > var5) {
               return null;
            } else if (var2 == this.d.StartRow && var4 == this.d.StartColumn && var3 == this.d.EndRow && var5 == this.d.EndColumn) {
               return this;
            } else if (var2 == range.d.StartRow && var4 == range.d.StartColumn && var3 == range.d.EndRow && var5 == range.d.EndColumn) {
               return range;
            } else {
               Range var6 = new Range(var2, var4, var3 - var2 + 1, var5 - var4 + 1, this.a);
               return var6;
            }
         }
      }
   }

   public ArrayList union(Range range) {
      ArrayList var2 = new ArrayList();
      if (this.a != range.a) {
         com.aspose.cells.b.a.a.ze.a(var2, (Object)this);
         com.aspose.cells.b.a.a.ze.a(var2, (Object)range);
         return var2;
      } else {
         int var3 = this.d.StartRow < range.d.StartRow ? range.d.StartRow : this.d.StartRow;
         int var4 = this.d.EndRow > range.d.EndRow ? range.d.EndRow : this.d.EndRow;
         int var5;
         int var6;
         if (var3 > var4) {
            if (var4 + 1 == var3 && this.d.StartColumn == range.d.StartColumn && this.d.EndColumn == range.d.EndColumn) {
               var5 = this.d.StartRow > range.d.StartRow ? range.d.StartRow : this.d.StartRow;
               var6 = this.d.EndRow < range.d.EndRow ? range.d.EndRow : this.d.EndRow;
               Range var14 = new Range(var5, this.d.StartColumn, var6 - var5 + 1, this.d.EndColumn - this.d.StartColumn + 1, this.a);
               com.aspose.cells.b.a.a.ze.a(var2, (Object)var14);
               return var2;
            } else {
               com.aspose.cells.b.a.a.ze.a(var2, (Object)this);
               com.aspose.cells.b.a.a.ze.a(var2, (Object)range);
               return var2;
            }
         } else {
            var5 = this.d.StartColumn < range.d.StartColumn ? range.d.StartColumn : this.d.StartColumn;
            var6 = this.d.EndColumn > range.d.EndColumn ? range.d.EndColumn : this.d.EndColumn;
            int var13;
            int var15;
            Range var16;
            if (var5 > var6) {
               if (var6 + 1 == var5 && this.d.StartRow == range.d.StartRow && this.d.EndRow == range.d.EndRow) {
                  var13 = this.d.StartColumn > range.d.StartColumn ? range.d.StartColumn : this.d.StartColumn;
                  var15 = this.d.EndColumn < range.d.EndColumn ? range.d.EndColumn : this.d.EndColumn;
                  var16 = new Range(this.d.StartRow, var13, this.d.EndRow - this.d.StartRow + 1, var15 - var13 + 1, this.a);
                  com.aspose.cells.b.a.a.ze.a(var2, (Object)var16);
                  return var2;
               } else {
                  com.aspose.cells.b.a.a.ze.a(var2, (Object)this);
                  com.aspose.cells.b.a.a.ze.a(var2, (Object)range);
                  return var2;
               }
            } else if (var3 == this.d.StartRow && var4 == this.d.EndRow && var5 == this.d.StartColumn && var6 == this.d.EndColumn) {
               com.aspose.cells.b.a.a.ze.a(var2, (Object)range);
               return var2;
            } else if (var3 == range.d.StartRow && var4 == range.d.EndRow && var5 == range.d.StartColumn && var6 == range.d.EndColumn) {
               com.aspose.cells.b.a.a.ze.a(var2, (Object)this);
               return var2;
            } else if (this.d.StartRow == range.d.StartRow && this.d.EndRow == range.d.EndRow) {
               var13 = this.d.StartColumn > range.d.StartColumn ? range.d.StartColumn : this.d.StartColumn;
               var15 = this.d.EndColumn < range.d.EndColumn ? range.d.EndColumn : this.d.EndColumn;
               var16 = new Range(this.d.StartRow, var13, this.d.EndRow - this.d.StartRow + 1, var15 - var13 + 1, this.a);
               com.aspose.cells.b.a.a.ze.a(var2, (Object)var16);
               return var2;
            } else if (this.d.StartColumn == range.d.StartColumn && this.d.EndColumn == range.d.EndColumn) {
               var13 = this.d.StartRow > range.d.StartRow ? range.d.StartRow : this.d.StartRow;
               var15 = this.d.EndRow < range.d.EndRow ? range.d.EndRow : this.d.EndRow;
               var16 = new Range(var13, this.d.StartColumn, var15 - var13 + 1, this.d.EndColumn - this.d.StartColumn + 1, this.a);
               com.aspose.cells.b.a.a.ze.a(var2, (Object)var16);
               return var2;
            } else {
               CellArea var7 = this.d;
               CellArea var8 = range.d;
               if (var7.StartRow > var8.StartRow) {
                  CellArea var9 = var7;
                  var7 = var8;
                  var8 = var9;
               }

               var16 = null;
               if (var7.StartRow < var8.StartRow) {
                  var16 = new Range(var7.StartRow, var7.StartColumn, var8.StartRow - var7.StartRow, var7.EndColumn - var7.StartColumn + 1, this.a);
                  com.aspose.cells.b.a.a.ze.a(var2, (Object)var16);
               }

               int var11 = this.d.StartColumn < range.d.StartColumn ? this.d.StartColumn : range.d.StartColumn;
               int var12 = this.d.EndColumn > range.d.EndColumn ? this.d.EndColumn : range.d.EndColumn;
               Range var10;
               if (var16 != null && var16.d.StartColumn == var11 && var16.d.EndColumn == var12) {
                  var16.d.EndRow = var4;
                  var10 = var16;
               } else {
                  var10 = new Range(var3, var11, var4 - var3 + 1, var12 - var11 + 1, this.a);
                  com.aspose.cells.b.a.a.ze.a(var2, (Object)var10);
               }

               if (var7.EndRow != var8.EndRow) {
                  CellArea var17 = new CellArea();
                  if (var7.EndRow > var8.EndRow) {
                     var17.StartRow = var8.EndRow + 1;
                     var17.EndRow = var7.EndRow;
                     var17.StartColumn = var7.StartColumn;
                     var17.EndColumn = var7.EndColumn;
                  } else {
                     var17.StartRow = var7.EndRow + 1;
                     var17.EndRow = var8.EndRow;
                     var17.StartColumn = var8.StartColumn;
                     var17.EndColumn = var8.EndColumn;
                  }

                  if (var10 != null && var10.d.StartColumn == var17.StartColumn && var10.d.EndColumn == var17.EndColumn) {
                     var10.d.EndRow = var17.EndRow;
                  } else {
                     Range var18 = new Range(var17.StartRow, var17.StartColumn, var17.EndRow - var17.StartRow + 1, var17.EndColumn - var17.StartColumn + 1, this.a);
                     com.aspose.cells.b.a.a.ze.a(var2, (Object)var18);
                  }
               }

               return var2;
            }
         }
      }
   }

   CellArea a() {
      return this.d;
   }

   Range(int firstRow, int firstColumn, int rowNumber, int columnNumber, Cells cells) {
      if (rowNumber != 0 && columnNumber != 0) {
         this.a = cells;
         int var6 = firstRow + rowNumber - 1;
         int var7 = firstColumn + columnNumber - 1;
         this.d.StartRow = firstRow;
         this.d.StartColumn = firstColumn;
         this.d.EndRow = var6;
         this.d.EndColumn = var7 & '\uffff';
      } else {
         throw new CellsException(6, "Number of rows or columns cannot be zero.");
      }
   }

   void a(int var1, int var2) {
      boolean var3 = false;
      boolean[] var4 = new boolean[]{var3};
      this.d = zayd.b(this.d, var1, var2, var4);
      var3 = var4[0];
   }

   void b(int var1, int var2) {
      int var3;
      boolean var5;
      if (this.d.StartRow >= var1) {
         var3 = this.d.StartRow + var2;
         if (var3 < 0) {
            var5 = false;
         } else if (var3 > 1048575) {
            this.d.StartRow = 1048575;
         } else {
            this.d.StartRow = var3;
         }

         int var4 = this.d.EndRow + var2;
         if (var4 > 1048575) {
            this.d.EndRow = 1048575;
         } else {
            this.d.EndRow = var4;
         }
      } else if (this.d.EndRow >= var1) {
         var3 = this.d.EndRow + var2;
         if (var3 < 0) {
            var5 = false;
         } else if (var3 > 1048575) {
            this.d.EndRow = 1048575;
         } else {
            this.d.EndRow = var3;
         }
      }

   }

   public int getRowCount() {
      return this.d.EndRow - this.d.StartRow + 1;
   }

   public int getColumnCount() {
      return this.d.EndColumn - this.d.StartColumn + 1;
   }

   public String getName() {
      return this.c;
   }

   public void setName(String value) {
      String var2 = value.trim();
      if (var2.length() > 255) {
         var2 = var2.substring(0, 255);
      }

      this.c = var2;
      int var3 = this.a.r().getNames().add(this.c);
      Name var4 = this.a.r().getNames().get(var3);
      var4.a(this.a.h().getIndex(), this.d);
   }

   void a(String var1) {
      this.c = var1;
   }

   public String getRefersTo() {
      StringBuilder var1 = new StringBuilder();
      var1.append("=");
      String var2 = this.a.h().getName();
      if (zakq.b(var2)) {
         var2 = "'" + var2 + "'";
      }

      var1.append(var2);
      var1.append("!");
      var1.append("$");
      var1.append(CellsHelper.columnIndexToName(this.a().StartColumn));
      var1.append("$");
      var1.append(this.a().StartRow + 1);
      if (this.a().StartRow != this.a().EndRow || this.a().StartColumn != this.a().EndColumn) {
         var1.append(":");
         var1.append("$");
         var1.append(CellsHelper.columnIndexToName(this.a().EndColumn));
         var1.append("$");
         var1.append(this.a().EndRow + 1);
      }

      return com.aspose.cells.b.a.zr.a(var1);
   }

   String b() {
      return this.a().StartRow == this.a().EndRow && this.a().StartColumn == this.a().EndColumn ? CellsHelper.cellIndexToName(this.a().StartRow, this.a().StartColumn) : CellsHelper.cellIndexToName(this.a().StartRow, this.a().StartColumn) + ":" + CellsHelper.cellIndexToName(this.a().EndRow, this.a().EndColumn);
   }

   String a(int var1, int var2, boolean var3) {
      return this.a().a(var1, var2, var3);
   }

   boolean a(int var1) {
      return this.a().a(var1);
   }

   boolean b(int var1) {
      return this.a().b(var1);
   }

   boolean c() {
      zahr var1 = this.a.getRows().a.a(this.d.StartRow, this.d.EndRow, false);

      label24:
      while(true) {
         zp var2;
         zahl var3;
         do {
            if (!var1.hasNext()) {
               return true;
            }

            var2 = var1.e();
            var3 = var2.b(this.d.StartColumn, this.d.EndColumn, false);
         } while(var3 == null);

         int var4;
         do {
            var4 = var3.a();
            if (var4 < 0) {
               continue label24;
            }
         } while(var2.h(var4) == 0);

         return false;
      }
   }

   public int getFirstRow() {
      return this.d.StartRow;
   }

   public int getFirstColumn() {
      return this.d.StartColumn;
   }

   public void merge() {
      this.a.merge(this.getFirstRow(), this.getFirstColumn(), this.getRowCount(), this.getColumnCount());
   }

   public void unMerge() {
      this.a.unMerge(this.getFirstRow(), this.getFirstColumn(), this.getRowCount(), this.getColumnCount());
   }

   public void putValue(String stringValue, boolean isConverted, boolean setStyle) {
      CellArea var4 = this.d;

      for(int var5 = var4.StartRow; var5 <= var4.EndRow; ++var5) {
         for(int var6 = var4.StartColumn; var6 <= var4.EndColumn; ++var6) {
            Cell var7 = this.a.a(var5, var6, false);
            var7.putValue(stringValue, isConverted, setStyle);
         }
      }

   }

   public Object getValue() {
      if (this.a().StartRow == this.a().EndRow && this.a().StartColumn == this.a().EndColumn) {
         Cell var1 = this.a.checkCell(this.a().StartRow, this.a().StartColumn);
         return var1 == null ? null : var1.getValue();
      } else {
         return this.a.exportArray(this.a().StartRow, this.a().StartColumn, this.a().EndRow - this.a().StartRow + 1, this.a().EndColumn - this.a().StartColumn + 1);
      }
   }

   public void setValue(Object value) {
      CellArea var2 = this.d;
      if (value != null && com.aspose.cells.a.c.zc.a(value)) {
         Object[] var11 = (Object[])((Object[])value);
         if (var11.length == 0) {
            return;
         }

         byte var12 = 1;
         switch(var12) {
         case 1:
            Object var13 = com.aspose.cells.b.a.za.a((Object[])var11, 0);
            int var6;
            if (com.aspose.cells.a.c.zc.a(var13)) {
               var6 = ((Object[])((Object[])var13)).length;

               for(int var7 = 0; var7 < var11.length; ++var7) {
                  Object[] var8 = (Object[])((Object[])com.aspose.cells.b.a.za.a(var11, var7));

                  for(int var9 = 0; var9 < var6; ++var9) {
                     Cell var10 = this.a.a(var7 + var2.StartRow, var9 + var2.StartColumn, false);
                     var10.putValue(com.aspose.cells.b.a.za.a(var8, var9));
                  }
               }
            } else {
               for(var6 = 0; var6 < var11.length; ++var6) {
                  Cell var14 = this.a.a(var2.StartRow, var6 + var2.StartColumn, false);
                  var14.putValue(com.aspose.cells.b.a.za.a(var11, var6));
               }
            }
         }
      } else {
         for(int var3 = var2.StartRow; var3 <= var2.EndRow; ++var3) {
            for(int var4 = var2.StartColumn; var4 <= var2.EndColumn; ++var4) {
               Cell var5 = this.a.a(var3, var4, false);
               var5.putValue(value);
            }
         }
      }

   }

   public void applyStyle(Style style, StyleFlag flag) {
      if (style.e() == null) {
         style.a(this.a.r());
      }

      CellArea var3 = this.d;
      RowCollection var4 = this.a.getRows();
      this.a.n();
      int var13;
      if (flag.getAll()) {
         int var12 = -1;
         if (style != null) {
            var12 = this.getWorksheet().c().a(style);
         }

         for(var13 = var3.StartRow; var13 <= var3.EndRow; ++var13) {
            Row var14 = var4.a(var13, false, true, false);

            for(int var15 = var3.StartColumn; var15 <= var3.EndColumn; ++var15) {
               Cell var16 = var14.c(var15);
               if (var13 == var3.StartRow && var13 != 0 && style.isModified(4)) {
                  var16.setStyle(style);
               }

               var16.b(var12);
            }
         }

      } else {
         HashMap var5 = new HashMap();
         boolean var6 = false;

         for(int var7 = var3.StartRow; var7 <= var3.EndRow; ++var7) {
            Row var8 = var4.a(var7, false, true, false);

            for(int var9 = var3.StartColumn; var9 <= var3.EndColumn; ++var9) {
               Cell var10 = var8.c(var9);
               Style var11;
               if ((var9 != var3.StartColumn || !flag.getBorders() && !flag.getLeftBorder()) && (var7 != var3.StartRow || !flag.getBorders() && !flag.getTopBorder())) {
                  var13 = var10.r();
                  if (var5.get(var13) != null) {
                     var10.b((Integer)var5.get(var13));
                  } else {
                     var11 = var10.o();
                     zakq.a(style, var11, flag);
                     var10.a(var11);
                     var5.put(var13, var10.s());
                  }
               } else {
                  var11 = var10.o();
                  zakq.a(style, var11, flag);
                  var10.setStyle(var11);
               }
            }
         }

      }
   }

   public void setStyle(Style style) {
      int var2 = -1;
      if (style != null) {
         var2 = this.a.r().a(style);
      }

      this.c(var2);
   }

   void c(int var1) {
      CellArea var2 = this.d;

      for(int var3 = var2.StartRow; var3 <= var2.EndRow; ++var3) {
         for(int var4 = var2.StartColumn; var4 <= var2.EndColumn; ++var4) {
            Cell var5 = this.a.a(var3, var4, false);
            var5.b(var1);
         }
      }

   }

   public void setOutlineBorders(int borderStyle, Color borderColor) {
      Style var3 = null;
      Cell var4 = null;
      int var5 = this.d.StartRow;
      int var6 = this.d.StartColumn;
      HashMap var7;
      int var8;
      if (this.d.StartRow == this.d.EndRow) {
         if (this.d.StartColumn == this.d.EndColumn) {
            var4 = this.a.a(var5, this.d.StartColumn, false);
            var3 = var4.o();
            var3.setBorder(1, borderStyle, borderColor);
            var3.setBorder(2, borderStyle, borderColor);
            var3.setBorder(4, borderStyle, borderColor);
            var3.setBorder(8, borderStyle, borderColor);
            var4.a(var3);
         } else {
            var4 = this.a.a(var5, this.d.StartColumn, false);
            var3 = var4.o();
            var3.setBorder(1, borderStyle, borderColor);
            var3.setBorder(4, borderStyle, borderColor);
            var3.setBorder(8, borderStyle, borderColor);
            var4.a(var3);
            var7 = new HashMap();

            for(var6 = this.d.StartColumn + 1; var6 < this.d.EndColumn; ++var6) {
               var4 = this.a.a(var5, var6, false);
               var8 = var4.r();
               if (var7.get(var8) != null) {
                  var4.b((Integer)var7.get(var8));
               } else {
                  var3 = var4.o();
                  var3.setBorder(4, borderStyle, borderColor);
                  var3.setBorder(8, borderStyle, borderColor);
                  var4.a(var3);
                  var7.put(var8, var4.s());
               }
            }

            var4 = this.a.a(this.d.StartRow, this.d.EndColumn, false);
            var3 = var4.o();
            var3.setBorder(2, borderStyle, borderColor);
            var3.setBorder(4, borderStyle, borderColor);
            var3.setBorder(8, borderStyle, borderColor);
            var4.a(var3);
         }
      } else if (this.d.StartColumn == this.d.EndColumn) {
         var4 = this.a.a(var5, var6, false);
         var3 = var4.o();
         var3.setBorder(1, borderStyle, borderColor);
         var3.setBorder(2, borderStyle, borderColor);
         var3.setBorder(4, borderStyle, borderColor);
         var4.a(var3);
         var7 = new HashMap();

         for(var5 = this.d.StartRow + 1; var5 < this.d.EndRow; ++var5) {
            var4 = this.a.a(var5, var6, false);
            var8 = var4.r();
            if (var7.get(var8) != null) {
               var4.b((Integer)var7.get(var8));
            } else {
               var3 = var4.o();
               var3.setBorder(1, borderStyle, borderColor);
               var3.setBorder(2, borderStyle, borderColor);
               var4.a(var3);
               var7.put(var8, var4.s());
            }
         }

         var4 = this.a.a(var5, var6, false);
         var3 = var4.o();
         var3.setBorder(1, borderStyle, borderColor);
         var3.setBorder(2, borderStyle, borderColor);
         var3.setBorder(8, borderStyle, borderColor);
         var4.a(var3);
      } else {
         var7 = null;
         var4 = this.a.a(var5, var6, false);
         var3 = var4.o();
         var3.setBorder(1, borderStyle, borderColor);
         var3.setBorder(4, borderStyle, borderColor);
         var4.a(var3);
         var7 = new HashMap();
         ++var6;

         for(; var6 < this.d.EndColumn; ++var6) {
            var4 = this.a.a(var5, var6, false);
            var8 = var4.r();
            if (var7.get(var8) != null) {
               var4.b((Integer)var7.get(var8));
            } else {
               var3 = var4.o();
               var3.setBorder(4, borderStyle, borderColor);
               var4.a(var3);
               var7.put(var8, var4.s());
            }
         }

         var4 = this.a.a(var5, var6, false);
         var3 = var4.o();
         var3.setBorder(2, borderStyle, borderColor);
         var3.setBorder(4, borderStyle, borderColor);
         var4.a(var3);
         var5 = this.d.EndRow;
         var6 = this.d.StartColumn;
         var4 = this.a.a(var5, var6, false);
         var3 = var4.o();
         var3.setBorder(1, borderStyle, borderColor);
         var3.setBorder(8, borderStyle, borderColor);
         var4.a(var3);
         var7 = new HashMap();
         ++var6;

         for(; var6 < this.d.EndColumn; ++var6) {
            var4 = this.a.a(var5, var6, false);
            var8 = var4.r();
            if (var7.get(var8) != null) {
               var4.b((Integer)var7.get(var8));
            } else {
               var3 = var4.o();
               var3.setBorder(8, borderStyle, borderColor);
               var4.a(var3);
               var7.put(var8, var4.s());
            }
         }

         var4 = this.a.a(var5, var6, false);
         var3 = var4.o();
         var3.setBorder(2, borderStyle, borderColor);
         var3.setBorder(8, borderStyle, borderColor);
         var4.a(var3);
         var5 = this.d.StartRow + 1;
         var6 = this.d.StartColumn;

         for(var7 = new HashMap(); var5 < this.d.EndRow; ++var5) {
            var4 = this.a.a(var5, var6, false);
            var8 = var4.r();
            if (var7.get(var8) != null) {
               var4.b((Integer)var7.get(var8));
            } else {
               var3 = var4.o();
               var3.setBorder(1, borderStyle, borderColor);
               var4.a(var3);
               var7.put(var8, var4.s());
            }
         }

         var5 = this.d.StartRow + 1;
         var6 = this.d.EndColumn;

         for(var7 = new HashMap(); var5 < this.d.EndRow; ++var5) {
            var4 = this.a.a(var5, var6, false);
            var8 = var4.r();
            if (var7.get(var8) != null) {
               var4.b((Integer)var7.get(var8));
            } else {
               var3 = var4.o();
               var3.setBorder(2, borderStyle, borderColor);
               var4.a(var3);
               var7.put(var8, var4.s());
            }
         }
      }

   }

   public void setOutlineBorders(int[] borderStyles, Color[] borderColors) {
      Style var3 = null;
      Cell var4 = null;
      int var5 = this.d.StartRow;
      int var6 = this.d.StartColumn;
      HashMap var7;
      int var8;
      if (this.d.StartRow == this.d.EndRow) {
         if (this.d.StartColumn == this.d.EndColumn) {
            var4 = this.a.a(var5, this.d.StartColumn, false);
            var3 = var4.o();
            var3.setBorder(1, borderStyles[2], borderColors[2]);
            var3.setBorder(2, borderStyles[3], borderColors[3]);
            var3.setBorder(4, borderStyles[0], borderColors[0]);
            var3.setBorder(8, borderStyles[1], borderColors[1]);
            var4.a(var3);
         } else {
            var4 = this.a.a(var5, this.d.StartColumn, false);
            var3 = var4.o();
            var3.setBorder(1, borderStyles[2], borderColors[2]);
            var3.setBorder(4, borderStyles[0], borderColors[0]);
            var3.setBorder(8, borderStyles[1], borderColors[1]);
            var4.a(var3);
            var7 = new HashMap();

            for(var6 = this.d.StartColumn + 1; var6 < this.d.EndColumn; ++var6) {
               var4 = this.a.a(var5, var6, false);
               var8 = var4.r();
               if (var7.get(var8) != null) {
                  var4.b((Integer)var7.get(var8));
               } else {
                  var3 = var4.o();
                  var3.setBorder(4, borderStyles[0], borderColors[0]);
                  var3.setBorder(8, borderStyles[1], borderColors[1]);
                  var4.a(var3);
                  var7.put(var8, var4.s());
               }
            }

            var4 = this.a.a(this.d.StartRow, this.d.EndColumn, false);
            var3 = var4.o();
            var3.setBorder(2, borderStyles[3], borderColors[3]);
            var3.setBorder(4, borderStyles[0], borderColors[0]);
            var3.setBorder(8, borderStyles[1], borderColors[1]);
            var4.a(var3);
         }
      } else if (this.d.StartColumn == this.d.EndColumn) {
         var4 = this.a.a(var5, var6, false);
         var3 = var4.o();
         var3.setBorder(1, borderStyles[2], borderColors[2]);
         var3.setBorder(2, borderStyles[3], borderColors[3]);
         var3.setBorder(4, borderStyles[0], borderColors[0]);
         var4.a(var3);
         var7 = new HashMap();

         for(var5 = this.d.StartRow + 1; var5 < this.d.EndRow; ++var5) {
            var4 = this.a.a(var5, var6, false);
            var8 = var4.r();
            if (var7.get(var8) != null) {
               var4.b((Integer)var7.get(var8));
            } else {
               var3 = var4.o();
               var3.setBorder(1, borderStyles[2], borderColors[2]);
               var3.setBorder(2, borderStyles[3], borderColors[3]);
               var4.a(var3);
               var7.put(var8, var4.s());
            }
         }

         var4 = this.a.a(var5, var6, false);
         var3 = var4.o();
         var3.setBorder(1, borderStyles[2], borderColors[2]);
         var3.setBorder(2, borderStyles[3], borderColors[3]);
         var3.setBorder(8, borderStyles[1], borderColors[1]);
         var4.a(var3);
      } else {
         var7 = null;
         var4 = this.a.a(var5, var6, false);
         var3 = var4.o();
         var3.setBorder(1, borderStyles[2], borderColors[2]);
         var3.setBorder(4, borderStyles[0], borderColors[0]);
         var4.a(var3);
         var7 = new HashMap();
         ++var6;

         for(; var6 < this.d.EndColumn; ++var6) {
            var4 = this.a.a(var5, var6, false);
            var8 = var4.r();
            if (var7.get(var8) != null) {
               var4.b((Integer)var7.get(var8));
            } else {
               var3 = var4.o();
               var3.setBorder(4, borderStyles[0], borderColors[0]);
               var4.a(var3);
               var7.put(var8, var4.s());
            }
         }

         var4 = this.a.a(var5, var6, false);
         var3 = var4.o();
         var3.setBorder(2, borderStyles[3], borderColors[3]);
         var3.setBorder(4, borderStyles[0], borderColors[0]);
         var4.a(var3);
         var5 = this.d.EndRow;
         var6 = this.d.StartColumn;
         var4 = this.a.a(var5, var6, false);
         var3 = var4.o();
         var3.setBorder(1, borderStyles[2], borderColors[2]);
         var3.setBorder(8, borderStyles[1], borderColors[1]);
         var4.a(var3);
         var7 = new HashMap();
         ++var6;

         for(; var6 < this.d.EndColumn; ++var6) {
            var4 = this.a.a(var5, var6, false);
            var8 = var4.r();
            if (var7.get(var8) != null) {
               var4.b((Integer)var7.get(var8));
            } else {
               var3 = var4.o();
               var3.setBorder(8, borderStyles[1], borderColors[1]);
               var4.a(var3);
               var7.put(var8, var4.s());
            }
         }

         var4 = this.a.a(var5, var6, false);
         var3 = var4.o();
         var3.setBorder(2, borderStyles[3], borderColors[3]);
         var3.setBorder(8, borderStyles[1], borderColors[1]);
         var4.a(var3);
         var5 = this.d.StartRow + 1;
         var6 = this.d.StartColumn;

         for(var7 = new HashMap(); var5 < this.d.EndRow; ++var5) {
            var4 = this.a.a(var5, var6, false);
            var8 = var4.r();
            if (var7.get(var8) != null) {
               var4.b((Integer)var7.get(var8));
            } else {
               var3 = var4.o();
               var3.setBorder(1, borderStyles[2], borderColors[2]);
               var4.a(var3);
               var7.put(var8, var4.s());
            }
         }

         var5 = this.d.StartRow + 1;
         var6 = this.d.EndColumn;

         for(var7 = new HashMap(); var5 < this.d.EndRow; ++var5) {
            var4 = this.a.a(var5, var6, false);
            var8 = var4.r();
            if (var7.get(var8) != null) {
               var4.b((Integer)var7.get(var8));
            } else {
               var3 = var4.o();
               var3.setBorder(2, borderStyles[3], borderColors[3]);
               var4.a(var3);
               var7.put(var8, var4.s());
            }
         }
      }

   }

   private void a(Cell var1, HashMap var2, int var3, int var4, Color var5) {
      int var6 = var1.r();
      if (var2.get(var6) != null) {
         var1.b((Integer)var2.get(var6));
      } else {
         Style var7 = var1.o();
         Border var8 = var7.getBorders().getByBorderType(var3);
         var8.setLineStyle(var4);
         var8.setColor(var5);
         var1.a(var7);
         var2.put(var6, var1.s());
      }
   }

   public void setOutlineBorder(int borderEdge, int borderStyle, Color borderColor) {
      int[] var4 = new int[]{1, 2, 4, 8};

      label77:
      for(int var5 = 0; var5 < var4.length; ++var5) {
         if ((borderEdge & var4[var5]) == var4[var5]) {
            Style var7 = null;
            CellArea var8 = this.d;
            HashMap var9 = new HashMap();
            HashMap var10 = new HashMap();
            Border var6;
            int var11;
            Cell var12;
            int var13;
            switch(var4[var5]) {
            case 1:
               var11 = var8.StartRow;

               while(true) {
                  if (var11 > var8.EndRow) {
                     continue label77;
                  }

                  var12 = this.a.a(var11, var8.StartColumn, false);
                  var13 = var12.r();
                  if (var9.get(var13) != null) {
                     var12.b((Integer)var9.get(var13));
                  } else {
                     var7 = var12.o();
                     var6 = var7.getBorders().getByBorderType(1);
                     var6.setLineStyle(borderStyle);
                     var6.setColor(borderColor);
                     var12.a(var7);
                     var9.put(var13, var12.s());
                  }

                  ++var11;
               }
            case 2:
               var11 = var8.StartRow;

               while(true) {
                  if (var11 > var8.EndRow) {
                     continue label77;
                  }

                  var12 = this.a.a(var11, var8.EndColumn, false);
                  var13 = var12.r();
                  if (var9.get(var13) != null) {
                     var12.b((Integer)var9.get(var13));
                  } else {
                     var7 = var12.o();
                     var6 = var7.getBorders().getByBorderType(2);
                     var6.setLineStyle(borderStyle);
                     var6.setColor(borderColor);
                     var12.a(var7);
                     var9.put(var13, var12.s());
                  }

                  ++var11;
               }
            case 3:
            case 5:
            case 6:
            case 7:
            default:
               return;
            case 4:
               var11 = var8.StartColumn;

               while(true) {
                  if (var11 > var8.EndColumn) {
                     continue label77;
                  }

                  var12 = this.a.a(var8.StartRow, var11, false);
                  this.a(var12, var9, 4, borderStyle, borderColor);
                  if (var8.StartRow != 0) {
                     var12 = this.a.a(var8.StartRow - 1, var11, true);
                     if (var12 != null) {
                        this.a(var12, var10, 8, borderStyle, borderColor);
                     }
                  }

                  ++var11;
               }
            case 8:
               for(var11 = var8.StartColumn; var11 <= var8.EndColumn; ++var11) {
                  var12 = this.a.a(var8.EndRow, var11, false);
                  var13 = var12.r();
                  if (var9.get(var13) != null) {
                     var12.b((Integer)var9.get(var13));
                  } else {
                     var7 = var12.o();
                     var6 = var7.getBorders().getByBorderType(8);
                     var6.setLineStyle(borderStyle);
                     var6.setColor(borderColor);
                     var12.a(var7);
                     var9.put(var13, var12.s());
                  }
               }
            }
         }
      }

   }

   public double getColumnWidth() {
      return this.a.getColumnWidth(this.getFirstColumn());
   }

   public void setColumnWidth(double value) {
      if (this.getColumnCount() < 16384) {
         CellArea var3 = this.d;

         for(int var4 = var3.StartColumn; var4 <= var3.EndColumn; ++var4) {
            this.a.setColumnWidth(var4, value);
         }
      } else {
         this.a.a(value);
      }

   }

   public double getRowHeight() {
      return this.a.getRowHeight(this.getFirstRow());
   }

   public void setRowHeight(double value) {
      if (value >= 0.0D && value <= 409.0D) {
         if (this.getRowCount() < 1048576) {
            CellArea var3 = this.d;

            for(int var4 = var3.StartRow; var4 <= var3.EndRow; ++var4) {
               this.a.setRowHeight(var4, value);
            }
         } else {
            this.a.setStandardHeight(value);
         }

      } else {
         throw new IllegalArgumentException();
      }
   }

   void a(Range var1) {
      this.d = var1.d;
      this.c = var1.c;
   }

   private void c(int var1, int var2) {
      int var3 = this.a.getColumns().e(var1);
      if (var3 > -1) {
         Column var4 = this.a.getColumns().getColumnByIndex(var3);
         this.a.getColumns().removeAt(var3);
         Column var5 = this.a.getColumns().get(var2);
         var5.a(var4);
      } else {
         var3 = this.a.getColumns().e(var2);
         if (var3 > -1) {
            this.a.getColumns().removeAt(var3);
         }
      }

   }

   private void d(int var1, int var2) {
      int var3 = this.a.getRows().d(var1);
      if (var3 != -1) {
         Row var4 = this.a.getRows().getRowByIndex(var3);
         this.a.getRows().removeAt(var3);
         Row var5 = this.a.getRows().a(var2, false, true, false);
         var5.a(var4);
      } else {
         var3 = this.a.getRows().d(var2);
         if (var3 != -1) {
            this.a.getRows().removeAt(var3);
         }
      }

   }

   private void a(int var1, int var2, int var3, int var4) {
      Cell var5 = this.a.checkCell(this.d.StartRow + var1, this.d.StartColumn + var2);
      if (var5 != null) {
         var5.C();
         int var7 = this.a.getRows().e(var3 + var1);
         Cell var6;
         if (var7 < 0) {
            var6 = this.a.getRows().a(var3 + var1, -var7 - 1, true).a(var4 + var2, false, true);
            var5.b();
         } else {
            Row var8 = this.a.getRows().b(var7, false);
            var7 = var8.a.b(var4 + var2);
            if (var7 < 0) {
               var6 = var8.a(this.a.getRows(), var4 + var2, -var7 - 1, true, true);
               var5.b();
            } else {
               var6 = var8.a(var7);
            }
         }

         var6.d(var5);
         if (var6.f()) {
            byte[] var9 = var6.v();
            zyo.a(this.d, var3, var4, this.a.h(), true, var9, -1, -1);
            var6.a(var9);
         }

         this.a.b(this.d.StartRow + var1, this.d.StartColumn + var2);
      } else {
         this.a.b(var3 + var1, var4 + var2);
      }

   }

   public void moveTo(int destRow, int destColumn) {
      if (destRow != this.d.StartRow || destColumn != this.d.StartColumn) {
         this.a.r().n().b();
         Range var3 = new Range(destRow, destColumn, this.getRowCount(), this.getColumnCount(), this.a);
         boolean var4 = false;
         int var5 = this.getRowCount();
         int var6 = this.getColumnCount();
         int var7;
         if (this.getRowCount() == 65536) {
            if (this.d.StartColumn < destColumn) {
               for(var7 = var6 - 1; var7 >= 0; --var7) {
                  this.c(this.d.StartColumn + var7, destColumn + var7);
               }
            } else {
               for(var7 = 0; var7 < var6; ++var7) {
                  this.c(this.d.StartColumn + var7, destColumn + var7);
               }
            }
         }

         if (this.getColumnCount() == 256) {
            if (this.d.StartRow < destRow) {
               for(var7 = var5 - 1; var7 >= 0; --var7) {
                  this.d(this.d.StartRow + var7, destRow + var7);
               }
            } else {
               for(var7 = 0; var7 < var5; ++var7) {
                  this.d(this.d.StartRow + var7, destRow + var7);
               }
            }
         }

         int var8;
         if (destRow > this.d.StartRow && destRow <= this.d.EndRow && destColumn >= this.d.StartColumn && destColumn <= this.d.EndColumn || destRow >= this.d.StartRow && destRow <= this.d.EndRow && destColumn > this.d.StartColumn && destColumn <= this.d.EndColumn) {
            var4 = true;

            for(var7 = var5 - 1; var7 >= 0; --var7) {
               for(var8 = var6 - 1; var8 >= 0; --var8) {
                  this.a(var7, var8, destRow, destColumn);
               }
            }
         }

         if (!var4) {
            for(var7 = 0; var7 < var5; ++var7) {
               for(var8 = 0; var8 < var6; ++var8) {
                  this.a(var7, var8, destRow, destColumn);
               }
            }
         }

         int var9;
         byte[] var11;
         for(var7 = 0; var7 < this.a.getRows().getCount(); ++var7) {
            Row var12 = this.a.getRows().getRowByIndex(var7);

            for(var9 = 0; var9 < var12.a(); ++var9) {
               Cell var10 = var12.getCellByIndex(var9);
               if (var10.f() && (var10.getRow() < destRow || var10.getRow() > var3.d.EndRow || var10.getColumn() < destColumn || var10.getColumn() > var3.d.EndColumn)) {
                  if (var10.x()) {
                     var10.K();
                  }

                  if (!var10.y()) {
                     var11 = var10.v();
                     zyo.a(this.d, destRow, destColumn, this.a.h(), true, var11, -1, -1);
                     var10.a(var11);
                  }
               }
            }
         }

         Worksheet var15 = this.a.h();
         NameCollection var13 = var15.c().getNames();

         for(var9 = 0; var9 < var13.getCount(); ++var9) {
            Name var14 = var13.get(var9);
            var11 = var14.b();
            if (var11 != null) {
               zyo.a(this.d, destRow, destColumn, this.a.h(), true, var11, -1, -1);
               var14.a(var11);
            }
         }

         var15.getComments().a(this.d, destRow - this.d.StartRow, destColumn - this.d.StartColumn);
         this.a.q().a(this.d, var5, var6, destRow, destColumn);
         this.d = new CellArea();
         this.d.StartRow = destRow;
         this.d.StartColumn = destColumn;
         this.d.EndRow = destRow + var5 - 1;
         this.d.EndColumn = destColumn + var6 - 1;
         if (this.c != null) {
            this.setName(this.c);
         }

      }
   }

   public void copyData(Range range) throws Exception {
      PasteOptions var2 = new PasteOptions();
      var2.setPasteType(8);
      this.copy(range, var2);
   }

   public void copyValue(Range range) throws Exception {
      PasteOptions var2 = new PasteOptions();
      var2.setPasteType(11);
      this.copy(range, var2);
   }

   void a(CellArea var1, PasteOptions var2) {
      switch(var2.getPasteType()) {
      case 0:
      case 1:
      case 2:
      case 3:
      case 8:
      case 9:
      case 11:
      case 12:
         Iterator var3 = this.getWorksheet().getListObjects().iterator();

         while(var3.hasNext()) {
            ListObject var4 = (ListObject)var3.next();
            if (var4.getShowHeaderRow() && var4.getStartRow() >= var1.StartRow && var4.getStartRow() <= var1.EndRow && var4.getStartColumn() <= var1.EndColumn && var4.getEndColumn() >= var1.StartColumn) {
               var4.updateColumnName();
            }
         }
      case 4:
      case 5:
      case 6:
      case 7:
      case 10:
      default:
      }
   }

   public void copyStyle(Range range) {
      CopyOptions var2 = new CopyOptions(false, 4);
      CellArea var3 = range.d;
      CellArea var4 = this.d;
      int var5 = var3.EndRow - var3.StartRow + 1;
      int var6 = var3.EndColumn - var3.StartColumn + 1;
      int var7 = var4.EndRow - var4.StartRow + 1;
      int var8 = var4.EndColumn - var4.StartColumn + 1;
      if (var5 > var7) {
         var5 = var7;
      }

      if (var6 > var8) {
         var6 = var8;
      }

      int var9;
      int var10;
      if (var5 == 65536) {
         for(var9 = var4.StartColumn; var9 < var4.StartColumn + var6; ++var9) {
            var10 = this.a.getColumns().e(var9);
            if (var10 > -1) {
               this.a.getColumns().removeAt(var10);
            }
         }

         for(var9 = var3.StartColumn; var9 <= var3.EndColumn; ++var9) {
            var10 = range.a.getColumns().e(var9);
            if (var10 > -1) {
               Column var11 = range.a.getColumns().getColumnByIndex(var10);
               Column var12 = this.a.getColumns().get(var11.getIndex() + var4.StartColumn - var3.StartColumn);
               var12.a(var11);
            }
         }
      }

      if (var6 == 256) {
         for(var9 = var4.StartRow; var9 < var4.StartRow + var5; ++var9) {
            var10 = this.a.getRows().d(var9);
            if (var10 != -1) {
               this.a.getRows().removeAt(var10);
            }
         }

         for(var9 = var3.StartRow; var9 <= var3.EndRow; ++var9) {
            var10 = range.a.getRows().d(var9);
            if (var10 != -1) {
               Row var15 = range.a.getRows().getRowByIndex(var10);
               Row var18 = this.a.getRows().a(var15.getIndex() + var4.StartRow - var3.StartRow, false, true, false);
               var18.a(var15);
            }
         }
      }

      boolean var16 = this.a.r() == range.a.r();

      for(var10 = 0; var10 < var5; ++var10) {
         for(int var17 = 0; var17 < var6; ++var17) {
            int var19 = range.e(var3.StartRow + var10, var3.StartColumn + var17);
            int var13 = this.a.c(var4.StartRow + var10, var4.StartColumn + var17);
            if ((var19 != var13 || !var16) && (var19 != -1 && var19 != 15 || var13 != -1 && var13 != 15)) {
               Cell var14 = this.a.a(var4.StartRow + var10, var4.StartColumn + var17, false);
               if (!var16 && var19 != -1 && var19 != 15) {
                  var14.a(range.a.r().f(var19));
               } else {
                  var14.b(var19);
               }
            }
         }
      }

      this.a(range, false);
      if (range.a.h().getConditionalFormattings().getCount() != 0) {
         this.a.h().getConditionalFormattings().a(range.a.h().getConditionalFormattings(), range.d, this.d, var2, false);
      }

   }

   private int e(int var1, int var2) {
      WorksheetCollection var3 = this.a.r();
      int var4 = this.a.c(var1, var2);
      Style var5 = var3.D();
      Style var6 = null;
      if (var4 != -1 && var4 != 15) {
         var5 = var3.B().a(var4);
      }

      Cell var7 = null;
      if (var1 == this.d.StartRow && var1 != 0 && var5.getBorders().getByBorderType(4).getLineStyle() == 0) {
         var7 = this.a.checkCell(var1 - 1, var2);
         if (var7 != null && var7.q()) {
            Style var8 = var7.o();
            if (var8.getBorders().getByBorderType(8).getLineStyle() != 0) {
               if (var6 == null) {
                  var6 = new Style(var3);
                  var6.copy(var5);
               }

               Border var9 = var6.getBorders().getByBorderType(4);
               var9.setLineStyle(var8.getBorders().getByBorderType(8).getLineStyle());
               var9.a.f(var8.getBorders().getByBorderType(8).a);
            }
         }
      }

      if (var6 != null) {
         var4 = var3.B().c(var6);
      }

      return var4;
   }

   private void a(Range var1, boolean var2) {
      CellArea var3 = this.a();
      CellArea var4 = var1.a();

      int var5;
      for(var5 = 0; var5 < this.a.q().getCount(); ++var5) {
         CellArea var6 = this.a.q().a(var5);
         if (var3.a(var6)) {
            this.a.q().removeAt(var5);
            --var5;
         }
      }

      var5 = var1.a.q().getCount();

      for(int var13 = 0; var13 < var5; ++var13) {
         CellArea var7 = var1.a.q().a(var13);
         if (var7.StartRow >= var4.StartRow && var7.EndRow <= var4.EndRow && var7.StartColumn >= var4.StartColumn && var7.EndColumn <= var4.EndColumn) {
            int var8 = var7.StartRow - var4.StartRow;
            int var9 = var7.StartColumn - var4.StartColumn;
            int var10 = var7.EndRow - var7.StartRow + 1;
            int var11 = var7.EndColumn - var7.StartColumn + 1;
            CellArea var12;
            if (var2) {
               var12 = new CellArea();
               var12.StartRow = var3.StartRow + var9;
               var12.EndRow = var12.StartRow + var11 - 1;
               var12.StartColumn = var3.StartColumn + var8;
               var12.EndColumn = var12.StartColumn + var10 - 1;
               this.a.q().a(var12);
            } else {
               var12 = new CellArea();
               var12.StartRow = var3.StartRow + var8;
               var12.EndRow = var12.StartRow + var10 - 1;
               var12.StartColumn = var3.StartColumn + var9;
               var12.EndColumn = var12.StartColumn + var11 - 1;
               this.a.q().a(var12);
            }
         }
      }

   }

   public void copy(Range range, PasteOptions options) throws Exception {
      if (options.getTranspose()) {
         this.a(range, options);
      } else {
         CellArea var3 = CellArea.c(this.d);
         CellArea var4 = CellArea.c(range.d);
         int var5 = range.getColumnCount();
         int var6 = range.getRowCount();
         boolean var7 = false;
         if (this.getRowCount() == 1) {
            if (this.getColumnCount() == 1) {
               this.d.EndRow = this.d.StartRow + range.getRowCount() - 1;
               this.d.EndColumn = this.d.StartColumn + range.getColumnCount() - 1;
               this.a(range, options);
               this.d = var3;
               return;
            }

            if (var5 == this.getColumnCount()) {
               var7 = true;
            }
         } else if (var5 == this.getColumnCount()) {
            if (var6 >= this.getRowCount()) {
               this.d.EndColumn = this.d.StartColumn + range.getColumnCount() - 1;
               this.a(range, options);
               this.d = var3;
               return;
            }

            var7 = this.getRowCount() % var6 == 0;
         } else {
            var7 = this.getRowCount() % var6 == 0 && this.getColumnCount() % var5 == 0;
         }

         if (!var7) {
            if (var5 != this.getColumnCount()) {
               this.d.EndColumn = this.d.StartColumn + var5 - 1;
               if (this.d.EndColumn > 16383) {
                  this.d.EndColumn = 16383;
                  range.d.EndColumn = range.d.StartColumn + 16383 - this.d.StartColumn;
               }
            }

            if (var6 != this.getRowCount()) {
               this.d.EndRow = this.d.StartRow + var6 - 1;
               if (this.d.EndRow > 1048575) {
                  this.d.EndRow = 1048575;
                  range.d.EndRow = range.d.StartRow + 1048575 - this.d.StartRow;
               }
            }
         }

         int var8 = (int)Math.ceil((double)this.getColumnCount() / (double)range.getColumnCount());
         int var9 = (int)Math.ceil((double)this.getRowCount() / (double)range.getRowCount());
         int var10 = this.getFirstColumn();
         int var11 = this.getFirstRow();

         for(int var12 = 0; var12 < var9; ++var12) {
            int var13 = var11 + range.getRowCount() * var12;
            int var14 = var13 + range.getRowCount() - 1;
            if (var14 >= var3.EndRow) {
               var14 = var3.EndRow;
               range.d.EndRow = range.d.StartRow + var14 - var13;
            }

            for(int var15 = 0; var15 < var8; ++var15) {
               int var16 = var10 + range.getColumnCount() * var15;
               int var17 = var16 + range.getColumnCount() - 1;
               if (var17 >= var3.EndColumn) {
                  var17 = var3.EndColumn;
                  range.d.EndColumn = range.d.StartColumn + var17 - var16;
               }

               this.d = CellArea.createCellArea(var13, var16, var14, var17);
               this.a(range, options);
            }
         }

         this.d = var3;
         range.d = var4;
      }
   }

   private void a(Range var1, PasteOptions var2) throws Exception {
      Cells var3 = var1.a;
      boolean[] var4 = null;
      int var5;
      if (var2.getOnlyVisibleCells()) {
         var4 = new boolean[var1.getColumnCount()];

         for(var5 = var1.a().StartColumn; var5 <= var1.a().EndColumn; ++var5) {
            Column var6 = var3.getColumns().c(var5);
            if (var6 != null && var6.isHidden()) {
               var4[var5 - var1.a().StartColumn] = true;
            }
         }
      }

      var5 = 0;
      if (var2.getPasteType() == 4 || var2.getPasteType() == 0 || var2.getPasteType() == 2) {
         for(int var26 = var1.a().StartColumn; var26 <= var1.a().EndColumn; ++var26) {
            int var7 = var26 - var1.a().StartColumn;
            if (var2.getOnlyVisibleCells() && var4[var7]) {
               ++var5;
            } else {
               double var8 = var3.getColumnWidth(var26);
               var7 -= var5;
               double var10 = this.a.getColumnWidth(this.a().StartColumn + var7);
               if (Math.abs(var8 - var10) > Double.MIN_VALUE) {
                  this.a.setColumnWidth(this.a().StartColumn + var7, var8);
               }
            }
         }

         if (var2.getPasteType() == 4) {
            return;
         }
      }

      CellArea var27 = var1.d;
      CellArea var28 = this.d;
      int var9;
      if (var2.getPasteType() == 5 || var2.getPasteType() == 0 || var2.getPasteType() == 2) {
         for(int var29 = var27.StartRow; var29 <= var27.EndRow; ++var29) {
            var9 = var1.a.getRows().d(var29);
            if (var9 != -1) {
               Row var31 = var1.a.getRows().getRowByIndex(var9);
               Row var11 = this.a.getRows().a(var31.getIndex() + var28.StartRow - var27.StartRow, false, true, false);
               var31.b();
               var11.setHeight(var31.getHeight());
               var11.setHidden(var31.isHidden());
            }
         }

         if (var2.getPasteType() == 5) {
            return;
         }
      }

      CopyOptions var30 = new CopyOptions(false, 4);
      Cell var15;
      int var32;
      int var33;
      int var35;
      Row var36;
      Row var40;
      if (var2.getTranspose()) {
         switch(var2.getPasteType()) {
         case 0:
         case 1:
         case 2:
         case 3:
         case 7:
         case 8:
         case 9:
         case 11:
         case 12:
            var9 = var1.a().EndRow - var1.a().StartRow + 1;
            var32 = var1.a().EndColumn - var1.a().StartColumn + 1;

            for(var33 = 0; var33 < var9; ++var33) {
               Row var12 = var1.a.checkRow(var33 + var1.a().StartRow);
               int var13;
               Cell var14;
               if (var12 == null) {
                  if (!var2.getSkipBlanks()) {
                     for(var13 = 0; var13 < var32; ++var13) {
                        var14 = this.a.checkCell(var13 + this.a().StartRow, var33 + this.a().StartColumn);
                        if (var14 != null) {
                           var14.b((Cell)null, var2.getPasteType());
                        }
                     }
                  }
               } else {
                  for(var13 = 0; var13 < var32; ++var13) {
                     var14 = var12.getCellOrNull(var13 + var1.a().StartColumn);
                     if (var14 != null || !var2.getSkipBlanks()) {
                        if (var14 == null) {
                           if (!var2.getSkipBlanks()) {
                              var15 = this.a.checkCell(var13 + this.a().StartRow, var33 + this.a().StartColumn);
                              if (var15 != null) {
                                 var15.b(var14, var2.getPasteType());
                              }
                           }
                        } else {
                           var15 = this.a.a(var13 + this.a().StartRow, var33 + this.a().StartColumn, false);
                           var14.b();
                           var15.b(var14, var2.getPasteType());
                        }
                     }
                  }
               }
            }

            this.a(this.d, var2);
         case 4:
         case 5:
         case 6:
         case 10:
         }
      } else {
         var9 = 0;
         switch(var2.getPasteType()) {
         case 0:
         case 1:
         case 2:
         case 3:
         case 7:
         case 8:
         case 9:
         case 11:
         case 12:
            label409: {
               var32 = var1.a().EndRow - var1.a().StartRow + 1;
               var33 = var1.a().EndColumn - var1.a().StartColumn + 1;
               if (this.a == var3) {
                  Object var34 = zayd.e(var1.a(), this.a());
                  if (var34 != null) {
                     CellArea var37 = (CellArea)var34;
                     Cell[][] var41 = new Cell[var32][];
                     zr var44 = var1.a.a(var32, 10, var33, 5);
                     zbbj var45 = new zbbj();
                     var45.a(0, var1.a);

                     int var17;
                     Row var18;
                     for(var17 = 0; var17 < var32; ++var17) {
                        var18 = var1.a.checkRow(var17 + var1.a().StartRow);
                        if (var18 != null) {
                           var41[var17] = new Cell[var33];
                           var45.a = var18.getIndex();
                           zp var19 = var44.f(var44.a(-1, var45, var33));
                           Row var20 = new Row(var1.a, var1.a.getRows(), var19, false);

                           for(int var21 = 0; var21 < var33; ++var21) {
                              Cell var22 = var18.getCellOrNull(var21 + var1.a().StartColumn);
                              if (var22 != null) {
                                 if (var22.getRow() >= var37.StartRow && var22.getRow() <= var37.EndRow && var22.getColumn() >= var37.StartColumn && var22.getColumn() <= var37.EndColumn) {
                                    zfv var23 = new zfv();
                                    var23.a = (short)var22.getColumn();
                                    int var24 = var19.a(-1, var23);
                                    if (var23.a > var1.a.getMaxColumn()) {
                                       var1.a.a(var23.a);
                                    }

                                    Cell var25 = new Cell(var20, var24);
                                    var25.d(var22);
                                    var41[var17][var21] = var25;
                                 } else {
                                    var41[var17][var21] = var22;
                                 }
                              }
                           }
                        }
                     }

                     var17 = 0;

                     while(true) {
                        if (var17 >= var32) {
                           break label409;
                        }

                        if (var41[var17] == null) {
                           if (!var2.getSkipBlanks()) {
                              var18 = this.a.checkRow(var17 + this.a().StartRow);
                              if (var18 != null) {
                                 for(int var48 = 0; var48 < var33; ++var48) {
                                    Cell var49 = var18.getCellOrNull(var48 + this.a().StartColumn);
                                    if (var49 != null) {
                                       var49.b((Cell)null, var2.getPasteType());
                                    }
                                 }
                              }
                           }
                        } else {
                           for(int var46 = 0; var46 < var33; ++var46) {
                              Cell var47;
                              if (var41[var17][var46] == null) {
                                 if (!var2.getSkipBlanks()) {
                                    var47 = this.a.checkCell(var17 + this.a().StartRow, var46 + this.a().StartColumn);
                                    if (var47 != null) {
                                       var47.b((Cell)null, var2.getPasteType());
                                    }
                                 }
                              } else {
                                 var47 = this.a.a(var17 + this.a().StartRow, var46 + this.a().StartColumn, false);
                                 var41[var17][var46].b();
                                 var47.b(var41[var17][var46], var2.getPasteType());
                              }
                           }
                        }

                        ++var17;
                     }
                  }
               }

               for(var35 = 0; var35 < var32; ++var35) {
                  var36 = var1.a.checkRow(var35 + var1.a().StartRow);
                  Cell var16;
                  if (var36 == null) {
                     if (!var2.getSkipBlanks()) {
                        var40 = this.a.checkRow(var35 + this.a().StartRow);
                        if (var40 != null) {
                           for(int var42 = 0; var42 < var33; ++var42) {
                              var16 = var40.getCellOrNull(var42 + this.a().StartColumn);
                              if (var16 != null) {
                                 var16.b((Cell)null, var2.getPasteType());
                              }
                           }
                        }
                     }
                  } else if (var36.isHidden() && var2.getOnlyVisibleCells()) {
                     ++var9;
                  } else {
                     var5 = 0;

                     for(int var38 = 0; var38 < var33; ++var38) {
                        var15 = var36.getCellOrNull(var38 + var1.a().StartColumn);
                        if (var2.getOnlyVisibleCells() && var4[var38]) {
                           ++var5;
                        } else if (var15 == null) {
                           if (!var2.getSkipBlanks()) {
                              var16 = this.a.checkCell(var35 + this.a().StartRow - var9, var38 + this.a().StartColumn - var5);
                              if (var16 != null) {
                                 var16.b((Cell)null, var2.getPasteType());
                              }
                           }
                        } else {
                           var16 = this.a.a(var35 + this.a().StartRow - var9, var38 + this.a().StartColumn - var5, false);
                           var15.b();
                           var16.b(var15, var2.getPasteType());
                        }
                     }
                  }
               }

               this.a(this.d, var2);
            }
         case 4:
         case 5:
         case 6:
         case 10:
         }
      }

      switch(var2.getPasteType()) {
      case 0:
      case 1:
      case 2:
      case 3:
      case 7:
         this.a(var1, var2.getTranspose());
         this.a.h().getConditionalFormattings().a(var1.a.h().getConditionalFormattings(), var1.a(), this.a(), var30, var2.getTranspose());
         var9 = var1.getColumnCount();
         var32 = var1.getRowCount();
         if (var1.getFirstRow() == 0 && var32 == 1048576) {
            for(var33 = var28.StartColumn; var33 < var28.StartColumn + var9; ++var33) {
               var35 = this.a.getColumns().e(var33);
               if (var35 > -1) {
                  this.a.getColumns().removeAt(var35);
               }
            }

            for(var33 = var27.StartColumn; var33 <= var27.EndColumn; ++var33) {
               var35 = var1.a.getColumns().e(var33);
               if (var35 > -1) {
                  Column var39 = var1.a.getColumns().getColumnByIndex(var35);
                  Column var43 = this.a.getColumns().get(var39.getIndex() + var28.StartColumn - var27.StartColumn);
                  var43.a(var39);
               }
            }
         }

         if (var1.getFirstColumn() == 0 && var1.getColumnCount() == 16384) {
            for(var33 = var28.StartRow; var33 < var28.StartRow + var32; ++var33) {
               var35 = this.a.getRows().d(var33);
               if (var35 != -1) {
                  this.a.getRows().removeAt(var35);
               }
            }

            for(var33 = var27.StartRow; var33 <= var27.EndRow; ++var33) {
               var35 = var1.a.getRows().d(var33);
               if (var35 != -1) {
                  var36 = var1.a.getRows().getRowByIndex(var35);
                  var40 = this.a.getRows().a(var36.getIndex() + var28.StartRow - var27.StartRow, false, true, false);
                  var36.b();
                  var40.a(var36);
               }
            }
         }
      case 4:
      case 5:
      case 6:
      default:
         switch(var2.getPasteType()) {
         case 0:
         case 1:
         case 2:
         case 3:
         case 6:
            this.a.h().getComments().a(var1, this, var2.getTranspose());
         case 4:
         case 5:
         default:
            switch(var2.getPasteType()) {
            case 0:
            case 1:
            case 2:
            case 3:
            case 10:
               this.a.h().getValidations().a(var1.a.h().getValidations(), var1.a(), this.a(), var30, var2.getTranspose());
            case 4:
            case 5:
            case 6:
            case 7:
            case 8:
            case 9:
            default:
               switch(var2.getPasteType()) {
               case 0:
               case 1:
               case 2:
               case 3:
                  if (var1.a.h().getShapes().getCount() != 0 && !var2.getTranspose()) {
                     this.a.h().getShapes().a(var1.a.h().getShapes(), var1.d, this.d, var30);
                  }

                  if (var1.a.h().getListObjects().getCount() > 0) {
                     this.a.h().getListObjects().a(var1.a.h().getListObjects(), var1.d, this.d, var30);
                  }

                  if (var1.a.h().getHyperlinks().getCount() != 0) {
                     this.a.h().getHyperlinks().a(var1.a.h().getHyperlinks(), var1.d, this.d);
                  }
               default:
               }
            }
         }
      }
   }

   public void copy(Range range) throws Exception {
      PasteOptions var2 = new PasteOptions();
      var2.setPasteType(1);
      this.copy(range, var2);
   }

   public Cell get(int rowIndex, int columnIndex) {
      if (rowIndex >= 0 && rowIndex < this.getRowCount() && columnIndex >= 0 && columnIndex < this.getColumnCount()) {
         return this.a.a(this.getFirstRow() + rowIndex, this.getFirstColumn() + columnIndex, false);
      } else {
         throw new CellsException(6, "Row or column is out of the range.");
      }
   }

   public Cell getCellOrNull(int rowIndex, int columnIndex) {
      if (rowIndex >= 0 && rowIndex < this.getRowCount() && columnIndex >= 0 && columnIndex < this.getColumnCount()) {
         return this.a.checkCell(this.getFirstRow() + rowIndex, this.getFirstColumn() + columnIndex);
      } else {
         throw new CellsException(6, "Row or column is out of the range.");
      }
   }

   public Worksheet getWorksheet() {
      return this.a.h();
   }

   public String toString() {
      return this.c != null ? com.aspose.cells.b.a.zv.a("Aspose.Cells.Range [ {0} : {1} ]", this.c, this.a.h().getName() + "!" + this.b()) : com.aspose.cells.b.a.zv.a("Aspose.Cells.Range [ {0} ]", this.a.h().getName() + "!" + this.b());
   }
}
